<template>
	<view>
		<view class="bg">
			<view>
				<view style="font-size: 34rpx;">
					萌萌安家
				</view>
				<view class="u-margin-top-20">设计让家如此温暖</view>
				<view class="u-margin-top-40 u-font-weight title ">设计订单</view>
				<view class="u-margin-top-40">您有订单待查收~</view>
			</view>

			<view style="margin-top: 40rpx;">
				<u-image :src="$ftpUrl('/commonDesign.png')" width="240" height="240" border-radius="40"></u-image>
			</view>
		</view>


		<view class="" style="width: 700rpx;margin:20rpx auto;">
			<view class="u-flex u-row-between">
				<u-image :src="$ftpUrl('/doorBook.png')" width="220" height="160" @click="go('/else/DesignBook/doorBook')">
				</u-image>
				<u-image :src="$ftpUrl('/budgetBook.png')" width="460" height="160"
					@click="go('/else/DesignBook/budget')"></u-image>
			</view>
			<view class="u-flex u-row-between">
				<u-image :src="$ftpUrl('/free_fire_Book.png')" width="220" height="340" @click="go('/else/DesignBook/free')">
				</u-image>
				<view>
					<u-image :src="$ftpUrl('/factoryBook.png')" width="220" height="160"
						@click="go('/else/DesignBook/family?id=9')"></u-image>
					<u-image :src="$ftpUrl('/familyBook.png')" width="220" height="160"
						@click="go('/else/DesignBook/family?id=8')"></u-image>
				</view>
				<view>
					<u-image :src="$ftpUrl('/parkBook.png')" width="220" height="160"
						@click="go('/else/DesignBook/family?id=10')"></u-image>
					<u-image :src="$ftpUrl('/publicBook.png')" width="220" height="160"
						@click="go('/else/DesignBook/public')"></u-image>
				</view>
			</view>
		</view>


		<view class="u-font-weight u-text-center u-margin-top-20 u-margin-bottom-20" style="font-size: 32rpx;">
			最新订单信息
		</view>

		<book :list="list" v-if="list.length" @go="goPage">
			<template #top="{orderType,status,designMoney,top}">
				<view style="color: #FF5D39;margin-bottom: 20rpx;font-weight: bold;">


					<text>{{orderType==5 && top==2 && top?'加急':orderType==5 && top==1?'插队':orderType==5 && top==0?'免费':orderType==8?'家装':orderType==9?'工装':orderType==10?'园林':orderType==12?'预算':''}}设计</text>
				</view>

			</template>
		</book>

		<u-loadmore :status="initial.status" />




	</view>
</template>

<script>
	import book from './components/book.vue';
	import loader from '@/common/loadPage.js';
	export default {
		mixins: [loader],
		components: {
			book
		},
		data() {
			return {
				list: [],
				initial: {
					geturl: "/indent/orderList",
					parm: {
						order_type: '5,10,8,12,9',
						state: '3,4,5,6'
					},
					isPage: true
				},

			}
		},
		onLoad() {
			this.getGoods()
		},
		methods: {
			go(e) {
				uni.navigateTo({
					url: e
				})
			},
			goPage(e) {
				switch (e.orderType) {
					case 9:
						uni.navigateTo({
							url: "/else/DesignBook/detail?id=" + e.id
						})
						break;
					case 8:
						uni.navigateTo({
							url: "/else/DesignBook/detail?id=" + e.id
						})
						break;
					case 10:
						uni.navigateTo({
							url: "/else/DesignBook/detail?id=" + e.id
						})
						break;
					case 12:
						uni.navigateTo({
							url: "/else/DesignBook/budget_detail?id=" + e.id
						})
						break;

					case 5:
						uni.navigateTo({
							url: "/else/DesignBook/free_detail?id=" + e.id
						})
						break;


				}

			}
		}
	}
</script>

<style>
	.bg {
		width: 750rpx;
		padding: 20rpx 20rpx 20rpx 50rpx;
		background: linear-gradient(to top, #FFCB87, #FF9D62);
		height: 400rpx;
		color: #fff;
		display: flex;
		justify-content: space-between;
	}

	.title {
		font-size: 50rpx;
		letter-spacing: 10rpx;

	}
</style>
